<template>
	<view class="detailItem" @click="goDetail(item.id)">
		<view class="article-item">
			<view class="article-title">{{item.title}}</view>
			<view class="article-desc">{{item.content}}</view>
			<view class="article-meta">
				<view class="meta-time">
					<text class="category">{{item.category ? item.category.cate_name : ""}}</text>
					<text>{{item.create_time}}</text>
				</view>
			</view>
		</view>
	</view>
</template>

<script setup>
	defineProps(['item'])
	const goDetail = (id) => {
		uni.navigateTo({
			url:"/pages/article/detail?id=" + id
		})
	}
</script>

<style scoped lang="scss">
	.article-item {
		padding: 20px 0;
		border-bottom: 1px solid #f0f0f0;
	}

	.article-item:last-child {
		border-bottom: none;
	}

	.article-title {
		font-size: 16px;
		font-weight: bold;
		margin-bottom: 10px;
		color: #333;
		white-space: nowrap;
		overflow: hidden;
		text-overflow: ellipsis;
	}

	.article-desc {
		font-size: 14px;
		color: #666;
		margin-bottom: 15px;
		line-height: 1.6;
		white-space: nowrap;
		overflow: hidden;
		text-overflow: ellipsis;
	}
	

	.article-meta {
		display: flex;
		justify-content: space-between;
	}

	.meta-time {
		font-size: 12px;
		color: #999;
		display: flex;
		align-items: center;
	}
	.meta-time .category{
		color: $theme-color;
		display: inline-block;
		margin-right: 20rpx;
	}
	.meta-time i {
		margin-right: 5px;
	}

	.meta-actions {
		display: flex;
	}

	.action-item {
		display: flex;
		align-items: center;
		margin-left: 15px;
	}

	.action-icon {
		margin-right: 5px;
		font-size: 16px;
		color: #999;
	}

	.action-count {
		font-size: 12px;
		color: #666;
	}
</style>